import axios from 'axios'
// redux-thunk风格
/*
function getCinemaListAction(){
    return(dispatch)=>{
    axios({
        method:'GET',
        url:"https://m.maizuo.com/gateway?cityId=440300&ticketFlag=1&k=2005318",
        headers:{
            "X-Client-Info": '{"a":"3000","ch":"1002","v":"5.2.0","e":"1654433035923688551579649"}',
            "X-Host": "mall.film-ticket.cinema.list"
        }    
    }).then(res=>{
        console.log(res.data.data.cinemas)
        dispatch({
            type:"change-list",
            list:res.data.data.cinemas
        })
    })
    }
}*/
//redux-promise
function getCinemaListAction(){
    return axios({
        method:'GET',
        url:"https://m.maizuo.com/gateway?cityId=440300&ticketFlag=1&k=2005318",
        headers:{
            "X-Client-Info": '{"a":"3000","ch":"1002","v":"5.2.0","e":"1654433035923688551579649"}',
            "X-Host": "mall.film-ticket.cinema.list"
        }    
    }).then(res=>{
        console.log(res.data.data.cinemas)
        return {
            type:"change-list",
            list:res.data.data.cinemas
        }
    })
    
}
export default getCinemaListAction;